package com.study.a13waitandnotify;

import java.util.concurrent.ArrayBlockingQueue;

public class ThreadDemo {
    public static void main(String[] args) {


        //创建阻塞队列
        ArrayBlockingQueue<String> queue = new ArrayBlockingQueue<>(1);

        //创建厨师和顾客
        Cook c=new Cook(queue);
        Foodie f=new Foodie(queue);
        c.setName("厨师");
        f.setName("顾客");
        c.start();
        f.start();

    }
}
